<template>
  <div id="changedialog">
    <commonformdialog
      :isshowDialogs="isshowDialog"
      :dialogTitle="dialogTitle"
      @closetextDialog="closetextDialog"
      @confirmbtn="confirmbtn"
      @rejected="rejected"
      :isshowFooter="false"
      :isshowFooterBh="isshowFooterBh"
    >
      <div class="innerLoding">
        <el-row>
          <el-form
            :model="formData"
            ref="ruleForm"
            label-width="120px"
            size="small"
          >
            <el-col :span="24">
              <!-- <div class="titleTips"></div> -->
              <h3 class="titleTips">
                入驻信息：<span class="look">{{ formData.statusText }}</span>
              </h3>
            </el-col>
            <el-col :span="12">
              <el-form-item label="驾校简称:" prop="short_title">
                <span>{{ formData.short_title }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="驾校全称:" prop="title">
                <span>{{ formData.title }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="城市:" prop="city">
                <span>{{ formData.city }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="状态:" prop="statusText">
                <span>{{ formData.statusText }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="姓名:" prop="leader_man">
                <span>{{ formData.leader_man }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="电话:" prop="leader_tel">
                <span>{{ formData.leader_tel }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="入驻时间:" prop="create_time">
                <span>{{ formData.create_time }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="提交时间:" prop="commit_time">
                <span>{{ formData.commit_time }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <div class="line"></div>
            </el-col>
            <el-col :span="24">
              <h3 class="titleTips">认证信息</h3>
            </el-col>
            <el-col :span="12">
              <el-form-item label="手持身份证照:" prop="id_card">
                <el-image
                  style="width: 100px; height: 100px"
                  :src="formData.id_card"
                  :preview-src-list="[formData.id_card]"
                  :zIndex="9999"
                >
                </el-image>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="管理员授权证明:" prop="grant">
                <el-image
                  style="width: 100px; height: 100px"
                  :src="formData.grant"
                  :preview-src-list="[formData.grant]"
                  :zIndex="9999"
                >
                </el-image>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="营业执照:" prop="license">
                <el-image
                  style="width: 100px; height: 100px"
                  :src="formData.license"
                  :preview-src-list="[formData.license]"
                  :zIndex="9999"
                >
                </el-image>
              </el-form-item>
            </el-col>
             <el-col :span="24">
              <div class="line"></div>
            </el-col>
            <el-col :span="24">
              <h3 class="titleTips">驾校信息</h3>
            </el-col>
            <el-col :span="12">
              <el-form-item label="驾校图片:" prop="head_img">
                <el-image
                  style="width: 100px; height: 100px"
                  :src="formData.head_img"
                  :preview-src-list="[formData.head_img]"
                  :zIndex="9999"
                >
                </el-image>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="道路运输许可证:" prop="road_permit">
                <el-image
                  style="width: 100px; height: 100px"
                  :src="formData.road_permit"
                  :preview-src-list="[formData.road_permit]"
                  :zIndex="9999"
                >
                </el-image>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="详细地址:" prop="address">
                <span>{{ formData.address }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="微信:" prop="wechat">
                <span>{{ formData.wechat }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="QQ:" prop="qq">
                <span>{{ formData.qq }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="驾校简介:" prop="description">
                <span>{{ formData.description }}</span>
              </el-form-item>
            </el-col>
          </el-form>
        </el-row>
      </div>
      <toExamine
        :isshowDialogE="isshowDialogE"
        :status="status"
        :id="id"
        @closedialogE="closeDialogE"
        @confirmbtnE="confirmbtnE"
      ></toExamine>
    </commonformdialog>
  </div>
</template>

<script type="text/javascript">
//引入弹窗
import commonformdialog from "@/components/commondialog/commondialog";
import toExamine from "./toExamine";

export default {
  data() {
    return {
      formData: {},
      isshowFooterBh: false,
      isshowDialogE: false,
      status: null,
      id: null,
    };
  },
  props: {
    //是否显示弹窗
    isshowDialog: {
      type: Boolean,
      default: false,
      required: true,
    },
    //表单的名字
    dialogTitle: {
      type: String,
      default: "",
      required: true,
    },
    //是编辑还是新增
    formType: {
      type: Number,
      default: 0,
    },
    dialogdata: {
      type: Object,
    },
  },
  components: {
    commonformdialog,
    toExamine,
  },
  methods: {
    closetextDialog() {
      this.$emit("closedialog");
    },
    //关闭审核弹框
    closeDialogE() {
      this.isshowDialogE = false;
    },
    //提交审核
    confirmbtnE() {
      this.isshowDialogE = false;
      //通知父级关闭弹框
      console.log("审核提交");
      this.$emit("confirm");
    },
    //驳回
    rejected() {
      this.status = 2;
      this.id = this.formData.id;
      this.isshowDialogE = true;
    },
    //通过
    confirmbtn() {
      this.status = 1;
      this.id = this.formData.id;
      this.isshowDialogE = true;
    },
  },
  watch: {
    isshowDialog: function (val) {
      if (!val) {
        this.$refs["ruleForm"].resetFields();
      }
    },
    dialogdata: function (val) {
      if (val) {
        this.formData = val;
      }
    },
    formType: function (val) {
      if (val === 0) {
        this.isshowFooterBh = false;
      } else {
        this.isshowFooterBh = true;
      }
    },
  },
  created() {},
};
</script>

<style lang="scss" scoped>

</style>
